package com.jrx.anytxn.transaction.service;



import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.i18n.response.TxnPage;
import com.jrx.anytxn.i18n.response.TxnRespResult;
import com.jrx.anytxn.transaction.dto.common.AccountMainInfoRes;
import com.jrx.anytxn.transaction.dto.common.LoanMainInfoRes;
import com.jrx.anytxn.transaction.dto.loan.LoanDetailQueryRes;
import com.jrx.anytxn.transaction.dto.loan.LoanInformationRes;
import com.jrx.anytxn.transaction.dto.loan.RepaymentPlanRes;
import com.jrx.anytxn.transaction.dto.payment.*;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName ICustomerOrderService
 *  为客户提供的查询账户和订单数据接口
 * @author  liy
 * date  2019/8/15
 * @Version V1.0
 **/
public interface ICustomerOrderService {
    /**
     * 获取客户定单
     *
     * @param channel 渠道
     * @param customerId 客户
     * @param tenantId 租户
     * @param pageNum 页码
     * @param pageSize 页长
     * @return 订单信息
     */
    TxnPage<LoanMainInfoRes> getLoanMainWithPage(String channel, String customerId, String tenantId, Integer pageNum, Integer pageSize, String loanId, String loanType, String beginDate, String endDate);

    /**
     * 获取客户还款列表
     *
     * @param customerId 客户id
     * @param loanId 订单id
     * @param tenantId 租户id
     * @return 还款计划列表
     */
    TxnRespResult<ArrayList<AmRepaymentPlanRes>> getRepaymentPlan(String customerId, String loanId, String tenantId);

    /**
     * 获取客户账户
     *
     * @param channel 渠道
     * @param customerId 客户
     * @param tenantId 租户
     * @param pageNum 页码
     * @param pageSize 页长
     * @return 客户账户信息
     */
    TxnPage<AccountMainInfoRes> getAccountMainWithPage(String channel,String customerId,String tenantId,Integer pageNum, Integer pageSize,String accountType ,String txnCode,String beginDate,String endDate);

    /**
     * 根据账户ID获取此信息
     * @author fan.yang
     * date: 2019/12/21 0021 下午 15:24
     * @param tenantId 租户ID
     * @param accountId 账户ID
     * @return com.jrx.anytxn.transaction.dto.payment.AmLoanMainInfoRes
     */
    AccountMainInfoRes getAmLoanMainInfoResByAccountId(String tenantId,String accountId,String customerId);

    /**
     * 根据订单ID查询信息
     * @author fan.yang
     * date: 2019/12/22 0022 下午 19:02
     * @param tenantId 租户ID
     * @param loanId 订单ID
     * @param customerId 客户ID
     * @return com.jrx.anytxn.transaction.dto.common.LoanMainInfoRes
     */
    ArrayList<LoanMainInfoRes> getLoanMainInfoByLoanId(String tenantId, String loanId, String customerId,String channel) throws TxnException;

    /**
     * 分页查询交易信息
     * @author fan.yang
     * date: 2020/1/14 0014 上午 11:57
     * @param channel 渠道
     * @param customerId 客户ID
     * @param tenantId 租户ID
     * @param pageNum 页码
     * @param pageSize 页大小
     * @param beginDate 交易起始时间
     * @param endDate 交易结束时间
     * @return com.jrx.anytxn.common.data.TxnPage<com.jrx.anytxn.transaction.dto.payment.TlTransactionInfoRes>
     */
    TxnPage<TlTransactionInfoRes> getTlTransactionInfoWithPage(String channel,String customerId,String tenantId,Integer pageNum,Integer pageSize,String beginDate,String endDate);

    /**
     * 查询单条交易信息
     * @author fan.yang
     * date: 2020/1/14 0014 上午 11:57
     * @param customerId 客户ID
     * @param tenantId 租户ID
     * @param channel 渠道
     * @param txnNumber 交易码
     * @return com.jrx.anytxn.transaction.dto.payment.TlTransactionInfoRes
     */
    TlTransactionInfoRes getTlTransactionInfo(String customerId, String tenantId, String channel, String txnNumber);

    /**
     * 查询单条还款计划信息
     * @author fan.yang
     * date: 2020/1/14 0014 上午 11:57
     * @param customerId 客户ID
     * @param tenantId 租户ID
     * @param channel 渠道
     * @param loanId 订单ID
     * @param billingTenor 期数
     * @return com.jrx.anytxn.transaction.dto.payment.AmRepaymentPlanRes
     */
    AmRepaymentPlanRes getOrderPlanByTenor(String customerId, String tenantId, String channel, String loanId, Integer billingTenor);

    TxnRespResult<ShowHandlePaymentRes> showHandlePayment(String customerId, String loanId, String tenantId, String channel) throws TxnException;

    TxnRespResult<ShowHandlePaymentRes> trailHandlePayment(String customerId, String loanId, String tenantId, String channel, String paymentMethod, String repayAmount, String principalAmount) throws TxnException;

    ArrayList<LoanInformationRes> getLoanInformation(String channel, String customerId, String tenantId) throws TxnBizException;

    ArrayList<LoanInformationRes> getLoanInformationByLoanId(String loanId, String customerId, String tenantId) throws TxnBizException;

}
